import React from 'react';
import { connect } from 'react-redux'
class Change extends React.Component {
  render() {
    console.log(this.props)
    let { changeName, changeAge, changeColor } = this.props;
    return <div className=''>
      <button onClick={() => { changeName('小红') }}>name</button>
      <button onClick={() => { changeAge(100) }}>age</button>
      <button onClick={() => { changeColor('blue') }}>color</button>
    </div>;
  }
}
Change = connect(() => ({}), dispatch => {
  return {
    changeName(name) {
      dispatch({ type: "changeName", name })
    },
    changeAge(age) {
      dispatch({ type: "changeAge", age })
    },
    changeColor(color) {
      dispatch({ type: "changeColor", color })
    },
  }
})(Change)
export default Change